package com.harry.resource.inner.entity;

import javax.persistence.Cacheable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.harry.basis.BasePoEntity;
import static com.harry.configuration.ConstSettings.*;

import lombok.Getter;
import lombok.Setter;

@Cacheable
@Getter
@Setter
@Entity
public class InnerDict extends BasePoEntity {

	private static final long serialVersionUID = 1L;

	@Column(length = BASIC_LENGTH)
	private String code;

	@Column(length = MEDIUM_LENGTH)
	private String value;

	@Column(length = MEDIUM_LENGTH)
	private String sno;

	@Fetch(FetchMode.JOIN)
	@ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.EAGER)
	@JoinColumn(nullable = false)
	private InnerDictGroup dictGroup;
}
